package com.ruoyi.system.wnjk.domain.po;

import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 体检订单对象 wnjk_physical_examination_order
 *
 * @author ruoyi
 * @date 2025-03-08
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PhysicalOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 订单编号（唯一标识，如“PE20250303XXXX”） */
    private String orderId;

    /** 下单用户ID（关联用户表） */
    @Excel(name = "下单用户ID", readConverterExp = "关=联用户表")
    private Long userId;

    /** 就诊人ID（关联就诊人表） */
    @Excel(name = "就诊人ID", readConverterExp = "关=联就诊人表")
    private Long patientId;

    /** 选择的体检套餐ID（外键，关联physical_examination_package表） */
    @Excel(name = "选择的体检套餐ID", readConverterExp = "外=键，关联physical_examination_package表")
    private Long packageId;

    /** 选择就诊的医院ID（外键，关联hospital表） */
    @Excel(name = "选择就诊的医院ID", readConverterExp = "外=键，关联hospital表")
    private Long hospitalId;

    /** 预约体检时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预约体检时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date appointmentTime;

    /** 下单时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date orderTime;

    /** 支付方式 */
    @Excel(name = "支付方式")
    private String paymentMethod;

    /** 支付时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date paymentTime;

    /** 总金额 */
    @Excel(name = "总金额")
    private BigDecimal totalAmount;

    /** 折扣金额 */
    @Excel(name = "折扣金额")
    private BigDecimal discountAmount;

    /** 订单状态 */
    @Excel(name = "订单状态")
    private String status;

    /** 订单有效期（套餐使用截止日期） */
    @Excel(name = "订单有效期", readConverterExp = "套=餐使用截止日期")
    private Date validUntil;

    /** 备注（如特殊要求） */
    @Excel(name = "备注", readConverterExp = "如=特殊要求")
    private String notes;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;

    @Excel(name = "订单编号", readConverterExp = "$column.readConverterExp()")
    private String outTradeNo;

    @Excel(name = "流水号", readConverterExp = "$column.readConverterExp()")
    private String tradeNo;



    // Getter 和 Setter 方法（Lombok 自动生成，但由于其他字段手动定义了，这里也手动添加）
    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getPatientId() {
        return patientId;
    }

    public void setPatientId(Long patientId) {
        this.patientId = patientId;
    }

    public Long getPackageId() {
        return packageId;
    }

    public void setPackageId(Long packageId) {
        this.packageId = packageId;
    }

    public Long getHospitalId() {
        return hospitalId;
    }

    public void setHospitalId(Long hospitalId) {
        this.hospitalId = hospitalId;
    }

    public Date getAppointmentTime() {
        return appointmentTime;
    }

    public void setAppointmentTime(Date appointmentTime) {
        this.appointmentTime = appointmentTime;
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    public String getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public Date getPaymentTime() {
        return paymentTime;
    }

    public void setPaymentTime(Date paymentTime) {
        this.paymentTime = paymentTime;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getDiscountAmount() {
        return discountAmount;
    }

    public void setDiscountAmount(BigDecimal discountAmount) {
        this.discountAmount = discountAmount;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getValidUntil() {
        return validUntil;
    }

    public void setValidUntil(Date validUntil) {
        this.validUntil = validUntil;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }




    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("orderId", getOrderId())
                .append("userId", getUserId())
                .append("patientId", getPatientId())
                .append("packageId", getPackageId())
                .append("hospitalId", getHospitalId())
                .append("appointmentTime", getAppointmentTime())
                .append("orderTime", getOrderTime())
                .append("paymentMethod", getPaymentMethod())
                .append("paymentTime", getPaymentTime())
                .append("totalAmount", getTotalAmount())
                .append("discountAmount", getDiscountAmount())
                .append("status", getStatus())
                .append("validUntil", getValidUntil())
                .append("notes", getNotes())
                .append("createdAt", getCreatedAt())
                .append("updatedAt", getUpdatedAt())
                .append("outTradeNo", getOutTradeNo())
                .append("tradeNo", getTradeNo())
                .toString();
    }
}